var express = require('express');
var router = express.Router();
const QuestModel = require("../db/questModel");
const AnswerModel = require("../db/answerModel");

module.exports = async (req, res) => {
    const {ids} = req.body
    const arr = eval(ids)
    var count = 0
    for(i = 0; i < arr.length; i++){
        var cc = await QuestModel.remove({"id":arr[i],"username":req.user.username})
        count += cc.deletedCount
    }
    res.send({
        "code":1,
        "deleteCount":count,
        "msg":"删除成功"
    })
};

